Vue.http.options.emulateJSON = true;
Vue.http.options.crossOrigin = true;
Vue.http.options.emulateHTTP = true;
//Vue.http.options.xhr = {withCredentials: true};
Vue.http.interceptors.push((request, next) => {
    console.log(`请求之前拦截：${request.url}`)
    request.credentials = true;
    // console.log(request.url.indexOf('.php') < 0)
    if (request.url.indexOf('.art') < 0 && request.url.indexOf('.php') < 0) {
        next((response) => {
            if (response.data.ret) {
                if (response.data.ret != 200) {
                    if (response.data.ret == 405) {
                        var url = location.href;
                        localStorage.loginSourceUrl = url;
                        // location.replace('https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx32de211a67640c3f&redirect_uri=http%3a%2f%2fwww.xinghou2018.cn%2fphalapi%2fpublic%2fcallback.php&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirectl')
                    } else {
                        mui.toast(`服务器错误，错误代码:${response.data.ret};\n${response.data.msg}`);
                        return;
                    }
                }
            } else {
                mui.toast('服务器异常，请稍后');
            }
        })
    }
})